package com.xiaotu.spring.service;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

/**
 * @author zhangxiao
 * @create 2021-11-08 9:41
 */
@Slf4j
public class TaskService implements InitializingBean, DisposableBean {

    public TaskService() {
        log.info("TaskService constructor execute...");
    }

    @PostConstruct
    private void postConstruct() {
        log.info("TaskService postConstruct...");
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        log.info("TaskService afterPropertiesSet...");
    }

    private void initMethod() {
        log.info("TaskService initMethod...");
    }

    @PreDestroy
    private void preDestroy() {
        log.info("TaskService preDestroy!!!");
    }

    private void destroyMethod() {
        log.info("TaskService destroyMethod!!!");
    }

    @Override
    public void destroy() throws Exception {
        log.info("TaskService destroy!!!");
    }

}
